<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>我的订单</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n, s) {
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/orders/orderList">我的订单</a></li>
	</ul>
	<form:form id="searchForm" action="${ctx}/orders/orderList" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li>
				<span><label>日期范围：</label></span>
				<input type="text" id="createDateQueryStart" name="createDateQueryStart" maxlength="20" readonly class="input-mini Wdate"
					value="${orders.createDateQueryStart }"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,maxDate:'#F{$dp.$D(\'createDateQueryEnd\')}'});"/>
				至&nbsp;
				<input type="text" id="createDateQueryEnd" name="createDateQueryEnd" maxlength="20" readonly class="input-mini Wdate"
					value="${orders.createDateQueryEnd }"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,minDate:'#F{$dp.$D(\'createDateQueryStart\')}'});"/>
			</li>
			<li>
				<span><label>&nbsp;&nbsp;状态：</label></span>
				<select name="orderstatus" class="input-mini">
					<option value="">全部</option>
					<option value="${TORDERS_STATUS_PAY }" ${orders.orderstatus == TORDERS_STATUS_PAY?'selected':'' }>已支付</option>
					<option value="${TORDERS_STATUS_NO_PAY }" ${orders.orderstatus == TORDERS_STATUS_NO_PAY?'selected':'' }>未支付</option>
					<option value="${TORDERS_STATUS_CANCEL }" ${orders.orderstatus == TORDERS_STATUS_CANCEL?'selected':'' }>作废</option>
				</select>
			</li>
			<li>
				<span><label>&nbsp;&nbsp;订单类型：</label></span>
				<select name="ordertype" class="input-small">
					<option value="">全部</option>
					<option value="${TORDERS_ORDER_TYPE_REALSCHE_SELF_TRAVEL }" ${orders.ordertype == TORDERS_ORDER_TYPE_REALSCHE_SELF_TRAVEL?'selected':'' }>自驾游车票</option>
					<option value="${TORDERS_ORDER_TYPE_RENTPRODUCT_DAY_BETWEEN }" ${orders.ordertype == TORDERS_ORDER_TYPE_RENTPRODUCT_DAY_BETWEEN?'selected':'' }>市内日租包车</option>
					<option value="${TORDERS_ORDER_TYPE_RENTPRODUCT_DAY_IN }" ${orders.ordertype == TORDERS_ORDER_TYPE_RENTPRODUCT_DAY_IN?'selected':'' }>跨市日租包车</option>
					<option value="${TORDERS_ORDER_TYPE_RENTPRODUCT_TRAVEL_ONE }" ${orders.ordertype == TORDERS_ORDER_TYPE_RENTPRODUCT_TRAVEL_ONE?'selected':'' }>单程旅游包车</option>
					<option value="${TORDERS_ORDER_TYPE_RENTPRODUCT_TRAVEL_TWO }" ${orders.ordertype == TORDERS_ORDER_TYPE_RENTPRODUCT_TRAVEL_TWO?'selected':'' }>往返旅游包车</option>
				</select>
			</li>
			<li class="btns"><input class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table class="table table-striped table-bordered table-condensed">
		<thead>
			<tr class="success">
				<th>产品名称</th>
				<th>订单日期</th>
				<th>购买数量</th>
				<th>订单金额</th>
				<th>订单状态</th>
				<th>订单类型</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="orders">
			<tr>
				<td>
					<c:if test="${orders.ordertype eq TORDERS_ORDER_TYPE_RENTPRODUCT_DAY_BETWEEN or
						orders.ordertype eq TORDERS_ORDER_TYPE_RENTPRODUCT_DAY_IN or
						orders.ordertype eq TORDERS_ORDER_TYPE_RENTPRODUCT_TRAVEL_ONE or
						orders.ordertype eq TORDERS_ORDER_TYPE_RENTPRODUCT_TRAVEL_TWO}">
						<c:set var="productType" value="rentproduct" />
						${orders.productname }
					</c:if>
					<c:if test="${orders.ordertype eq TORDERS_ORDER_TYPE_REALSCHE_SELF_TRAVEL}">
						<c:set var="productType" value="realsche" />
						${orders.schename }
					</c:if>
				</td>
				<td><fmt:formatDate value="${orders.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>${orders.purchasenum+orders.childnum}</td>
				<td>￥${orders.dueamount}</td>
				<td>
					<c:if test="${orders.orderstatus == TORDERS_STATUS_PAY}">已支付</c:if>
					<c:if test="${orders.orderstatus == TORDERS_STATUS_NO_PAY}">未支付</c:if>
					<c:if test="${orders.orderstatus == TORDERS_STATUS_CANCEL}">作废</c:if>
				</td>
				<td>
					${orders.ordertype == TORDERS_ORDER_TYPE_REALSCHE_SELF_TRAVEL?'自助游车票':'' }
					${orders.ordertype == TORDERS_ORDER_TYPE_RENTPRODUCT_DAY_BETWEEN?'市内日租包车':'' }
					${orders.ordertype == TORDERS_ORDER_TYPE_RENTPRODUCT_DAY_IN?'跨市日租包车':'' }
					${orders.ordertype == TORDERS_ORDER_TYPE_RENTPRODUCT_TRAVEL_ONE?'单程旅游包车':'' }
					${orders.ordertype == TORDERS_ORDER_TYPE_RENTPRODUCT_TRAVEL_TWO?'往返旅游包车':'' }
				</td>
				<td style="${orders.orderstatus == TORDERS_STATUS_CANCEL?'background-color:#FCF8E3;':''}">
					<c:if test="${orders.orderstatus == TORDERS_STATUS_NO_PAY}">
						<a href="${ctx}/${productType }/pay/payWay?orderid=${orders.orderid}">支付</a>&nbsp;
						<a href="${ctx}/${productType }/pay/cancel?orderid=${orders.orderid}">取消订单</a>
					</c:if>
					<c:if test="${orders.orderstatus == TORDERS_STATUS_PAY}">
						<a href="${ctx}/${productType }/realsche/backMoney?orderid=${orders.orderid}">退票</a>
					</c:if>
				</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>